﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Utils
{
	public class Utilities
	{
		public static int getInt32(object obj)
		{
			try
			{
				return Convert.ToInt32(obj);
			}
			catch
			{
				return 0;
			}
		}
		public static string getString(object obj)
		{
			try
			{
				return Convert.ToString(obj);
			}
			catch
			{
				return string.Empty;
			}
		}
		public static DateTime getDateTime(object obj)
		{
			try
			{
				return Convert.ToDateTime(obj);
			}
			catch
			{
				return DateTime.MinValue;
			}
		}
		public static decimal getDecimal(object obj)
		{
			try
			{
				return Convert.ToDecimal(obj);
			}
			catch
			{
				return 0;
			}
		}

	}
}
